package com.zhouyu.service;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author leimingchao
 * create 2025-05-11 16:22
 */
@Component
public class ZhouyuBeanFactoryPostProcessor implements BeanDefinitionRegistryPostProcessor {


	/**
	 * 允许注册BeanDefinition
	 *
	 * @param registry the bean definition registry used by the application context
	 * @throws BeansException
	 */
	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {

	}

	/**
	 *  不允许注册BeanDefinition，可以拿到BeanDefinition并且修改BeanDefinition里面的信息
	 *
	 * @param beanFactory the bean factory used by the application context
	 * @throws BeansException
	 */
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

	}
}
